home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cocktail / reuse.lha / reuse / src / Errors.md < prev    next >
Text File  |  1992-08-18  |  2KB  |  84 lines

  1. (* $Id: Errors.md,v 1.0 1992/08/07 14:41:58 grosch rel $ *)
  2.  
  3. (* $Log: Errors.md,v $
  4. # Revision 1.0  1992/08/07  14:41:58  grosch
  5. # Initial revision
  6. #
  7.  *)
  8.  
  9. (* Ich, Doktor Josef Grosch, Informatiker, Juli 1992 *)
  10.  
  11. DEFINITION MODULE Errors;
  12.  
  13. FROM SYSTEM    IMPORT ADDRESS;
  14. FROM Positions    IMPORT tPosition;
  15. FROM IO        IMPORT tFile;
  16.  
  17. CONST
  18.    NoText        = 0    ;
  19.    SyntaxError        = 1    ;    (* error codes        *)
  20.    ExpectedTokens    = 2    ;
  21.    RestartPoint        = 3    ;
  22.    TokenInserted    = 4    ;
  23.    WrongParseTable    = 5    ;
  24.    OpenParseTable    = 6    ;
  25.    ReadParseTable    = 7    ;
  26.    TooManyErrors    = 8    ;
  27.  
  28.    Fatal        = 1    ;    (* error classes    *)
  29.    Restriction        = 2    ;
  30.    Error        = 3    ;
  31.    Warning        = 4    ;
  32.    Repair        = 5    ;
  33.    Note            = 6    ;
  34.    Information        = 7    ;
  35.  
  36.    None            = 0    ;
  37.    Integer        = 1    ;    (* info classes        *)
  38.    Short        = 2    ;
  39.    Long            = 3    ;
  40.    Real            = 4    ;
  41.    Boolean        = 5    ;
  42.    Character        = 6    ;
  43.    String        = 7    ;
  44.    Array        = 8    ;
  45.    Set            = 9    ;
  46.    Ident        = 10    ;
  47.  
  48. VAR      Exit        : PROC;
  49.             (* Refers to a procedure that specifies        *)
  50.             (* what to do if 'ErrorClass' = Fatal.        *)
  51.             (* Default: terminate program execution.    *)
  52.  
  53. PROCEDURE StoreMessages (Store: BOOLEAN);
  54.             (* Messages are stored if 'Store' = TRUE    *)
  55.             (* for printing with the routine 'WriteMessages'*)
  56.             (* otherwise they are printed immediately.    *)
  57.             (* If 'Store'=TRUE the message store is cleared.*)
  58.  
  59. PROCEDURE ErrorMessage    (ErrorCode, ErrorClass: CARDINAL; Position: tPosition);
  60.             (* Report a message represented by an integer    *)
  61.             (* 'ErrorCode' and classified by 'ErrorClass'.    *)
  62.  
  63. PROCEDURE ErrorMessageI    (ErrorCode, ErrorClass: CARDINAL; Position: tPosition;
  64.              InfoClass: CARDINAL; Info: ADDRESS);
  65.             (* Like the previous routine with additional    *)
  66.             (* information of type 'InfoClass' at the    *)
  67.             (* address 'Info'.                *)
  68.  
  69. PROCEDURE Message  (ErrorText: ARRAY OF CHAR; ErrorClass: CARDINAL; Position: tPosition);
  70.             (* Report a message represented by a string    *)
  71.             (* 'ErrorText' and classified by 'ErrorClass'.    *)
  72.  
  73. PROCEDURE MessageI (ErrorText: ARRAY OF CHAR; ErrorClass: CARDINAL; Position: tPosition;
  74.              InfoClass: CARDINAL; Info: ADDRESS);
  75.             (* Like the previous routine with additional    *)
  76.             (* information of type 'InfoClass' at the    *)
  77.             (* address 'Info'.                *)
  78.  
  79. PROCEDURE WriteMessages    (File: tFile);
  80.             (* The stored messages are sorted by their    *)
  81.             (* source position and printed on 'File'.    *)
  82.  
  83. END Errors.
  84.